﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NextCMS.Models;

/// <summary>
/// Summary description for TopMenu
/// </summary>
/// 
namespace Modules
{
    public class TopMenu : IPageModule
    {
        public string GetLayoutModeHTML(PageModuleModel pmm, ModuleModel mm, int UserLanguageId)
        {
            string url = VirtualPathUtility.ToAbsolute(mm.Settings);
            string width = "300";
            string height = "300";
            url = url + "?Id=" + pmm.RefId + "&PageModuleId=" + pmm.Id + "";
            if (pmm.RefId > 0)
            {
                return "<div class='Module' onclick='javascript:OpenEditModuleDialog(\"" + mm.Code + "\"," + pmm.RefId + "," + pmm.Id + ","+url+","+width+","+height+");'></div>";
            }
            else
            {
                return "<div class='Module' onclick='javascript:OpenEditModuleDialog(\"" + mm.Code + "\",0," + pmm.Id + "," + url + "," + width + "," + height + ");'>Menu</div>";
            }
        }
        public string GetViewModeHTML(PageModuleModel pmm, ModuleModel mm, int UserLanguageId)
        {
            if (pmm.RefId > 0)
            {
                return "Menu";
            }
            else
            {
                return "Menu";
            }
        }
    }
}